<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>修改客户信息</title>
  </head>
  
  <body>
  		<form action="${pageContext.request.contextPath }/servlet/CustomerController?operate=editCustomer" method="post">
  			<table border="1" align="center" >
  				<tr>
  					<td>姓名：</td>
  					<td>
  						<input type="text" name="name" value="${customer.name }" />
  					</td>
  				</tr>
  				<tr>
  					<td>性别：</td>
  					<td>
  						<input type="radio" name="gender" value="男" ${customer.gender =='男' ? 'checked="checked"' : '' }/>男
  						<input type="radio" name="gender" value="女" ${customer.gender =='女' ? 'checked="checked"' : '' }/>女
  					</td>
  				</tr>
  				<tr>
  					<td>生日(yyyy-mm-dd)：</td>
  					<td>
  						<input type="text" name="birthday" value="${customer.birthday }"/>
  					</td>
  				</tr>
  				<tr>
  					<td>手机：</td>
  					<td>
  						<input type="text" name="cellphone" value="${customer.cellphone }"/>
  					</td>
  				</tr>
  				<tr>
  					<td>邮箱：</td>
  					<td>
  						<input type="text" name="email" value="${customer.email }"/>
  					</td>
  				</tr>
  				<tr>
  					<td>客户爱好：</td>
  					<td>
  						<input type="checkbox" name="hobbies" value="吃饭" ${fn:contains(customer.preference, '吃饭') ? 'checked="checked"' : ''  }/>吃饭
  						<input type="checkbox" name="hobbies" value="看电影" ${fn:contains(customer.preference, '看电影') ? 'checked="checked"' : ''  }/>看电影
  						<input type="checkbox" name="hobbies" value="学习" ${fn:contains(customer.preference, '学习') ? 'checked="checked"' : ''  }/>学习
  					</td>
  				</tr>
  				<tr>
  					<td>类型：</td>
  					<td>
  						<input type="radio" name="type" value="普通客户" ${customer.type == '普通客户' ? 'checked="checked"' : '' }/>普通客户
  						<input type="radio" name="type" value="VIP客户" ${customer.type == 'VIP客户' ? 'checked="checked"' : '' }/>VIP客户
  					</td>
  				</tr>
  				<tr>
  					<td>简介：</td>
  					<td>
  						<textarea rows="3" cols="38" name="description">${customer.description }</textarea>
  					</td>
  				</tr>
  				<tr>
  					<td colspan="2" align="center">
  						<input type="hidden" name="id" value="${customer.id }">
  						<input type="submit" value="提交">
  					</td>
  				</tr>
  			</table>
  		</form>
  </body>
</html>
